package tjut.opp.test7;

import java.util.Scanner;

public class CountTest {

	public static void main(String[] args) {
		 Scanner input =new Scanner(System.in);
		    System.out.println("输入一个字符串:");
		    String str=input.nextLine();
		   
		    int letter=0;
		    int number=0;
		    int blank=0;
		    int other=0;
		    for(int i=0;i<str.length();i++)
		    {
		    	//65-90 大写 
		    	if((str.charAt(i)>=65&&str.charAt(i)<=90)||(str.charAt(i)>=97&&str.charAt(i)<=122)){
		    		letter++;
		    	}else if(str.charAt(i)>48&&str.charAt(i)<=57){
		    		number++;
		    	}else if(str.charAt(i)==32||str.charAt(i)==9){
		    		blank++;
		    	}else{
		    		other++;
		    	}
		    }
		    System.out.println("有"+letter+"个字母,"+number+"个数字,"+blank+"个空白字符,"+other+"个其他字符");
		    
	}
}


